#include "GameObject.h"

void CGameObject::draw()
{
    
    //std::cout << "Pos " << m_vPos[0] << ", " << m_vPos[1] << std::endl;
    //std::cout << "Color " << m_Color.r << ", " << m_Color.g << std::endl;
    
    glPushMatrix();
        
        glRotatef(m_fAngle, 0, 0, 1);
        glTranslatef(m_vPos[0], m_vPos[1], 0);
        glScalef(m_fSize, m_fSize, 0);
        
        glColor4f(m_Color.r, m_Color.g, m_Color.b, m_Color.a);
        
        glBindTexture(GL_TEXTURE_2D, m_iTexture);
        
        glBegin(GL_TRIANGLE_STRIP);
            
            glVertex3f(-0.5, 0.5, 0);
            glTexCoord2f(0, 0);
            glVertex3f(-0.5, -0.5, 0);
            glTexCoord2f(0, 1);
            glVertex3f(0.5, 0.5, 0);
            glTexCoord2f(1, 0);
            glVertex3f(0.5, -0.5, 0);
            glTexCoord2f(1, 1);
            
        glEnd();
        
    glPopMatrix();
    
}
